package com.zzr.demo.redis.service;

/**
 * @author: xiaomi
 * @date: 2021/10/7
 * @description: 计数器服务
 */
public interface CounterService {

    ThreadLocal<String> iptl = new ThreadLocal<>();

    boolean init(int value);

    /**
     * 自增1
     *
     * @return
     */
    long increase();

    /**
     * 自增 num
     *
     * @param num
     * @return
     */
    long increase(int num);

    /**
     * 自减1
     *
     * @return
     */
    long decrease();

    /**
     * 自减 num
     *
     * @param num
     * @return
     */
    long decrease(int num);


}
